//
//  OrderInfoPreviewModel.swift
//  koolcar
//
//  Created by kuaimaxiansheng on 2022/8/8.
//

import UIKit
import ObjectMapper
class OrderInfoPreviewModel:  Mappable {
    var code: String?
    var msg: String?
    var data: OrderInfoModel?
    
    func mapping(map: Map) {
        code <- map["code"]
        msg <- map["msg"]
        data <- map["data"]
    }
    required init?(map: Map) {
        
    }
}

class OrderInfoModel:  Mappable {
    
    var refreshDataBlock: (()->Void)?//刷新订单详情
    
    var createdTime: String?
    var delFlag: String?
    var orderNo: String?//订单号
    var type: String?//类型
    var price: Double?//订单价钱
    var memberId: Int?//用户id
    var paymentPhone: String?//用户手机号
    var paymentName: String?//用户姓名
    var orderTime: String?//下单时间
    var effectiveTime: String?//有效时间
    var payType: String?//付款类型
    var status: NSInteger?//状态 1:预定 ；2：已支付 3：已完成 4：退订 5:已取消
    var subscribeType: NSInteger? //表示车辆订购中
    var items: [ShoppingCarListModel]?
    var orderitemDTOList: [PreviewProductItemModel]?
  
    var firstName: String?
    var lastName: String?
    var email: String?
    var paymentTime: String?//支付时间
    
    var serverName: String?//"洗车服务"，//服务名称
    var carName: String?//车辆名称
    var productImage: String?//车辆或者服务图片
    var depositAmount: Double?//订金金额
    var carNo: String?
    var couponCodeDTO: CouponCodeDTOModel?//优惠券信息

    
    
    func mapping(map: Map) {
        subscribeType <- map["subscribeType"]
        createdTime <- map["createdTime"]
        delFlag <- map["delFlag"]
        type <- map["type"]
        price <- map["price"]
        memberId <- map["memberId"]
        paymentPhone <- map["paymentPhone"]
        paymentName <- map["paymentName"]
        orderTime <- map["orderTime"]
        effectiveTime <- map["effectiveTime"]
        payType <- map["payType"]
        status <- map["status"]
        items <- map["items"]
        orderitemDTOList <- map["orderitemDTOList"]
        firstName <- map["firstName"]
        lastName <- map["lastName"]
        email <- map["email"]
        orderNo <- map["orderNo"]
        paymentTime <- map["paymentTime"]
        serverName <- map["serverName"]
        carName <- map["carName"]
        productImage <- map["productImage"]
        depositAmount <- map["depositAmount"]
        carNo <- map["carNo"]
        couponCodeDTO  <- map["couponCodeDTO"]
        
    }
    required init?(map: Map) {
        
    }
}


class CouponCodeDTOModel:  Mappable {
    var couponId: NSInteger?
    var couponName: String?
    var fullPrice: Double?
    var giftTypeStr: String?
    var id: NSInteger?
    var reducePrice: Double?
    var validTime: String?
    var couponCode: String?
    
    func mapping(map: Map) {
        couponId <- map["couponId"]
        couponName <- map["couponName"]
        fullPrice <- map["fullPrice"]
        giftTypeStr <- map["giftTypeStr"]
        id <- map["id"]
        reducePrice <- map["reducePrice"]
        validTime <- map["validTime"]
        couponCode <- map["couponCode"]
    }
    required init?(map: Map) {
        
    }
}
